import json

# 登录接口通用断言函数
import app


def api_assert(testself, resq, status_code, status, msg):

    testself.assertEqual(status_code, resq.status_code)
    testself.assertEqual(status, resq.json().get('status'))
    testself.assertIn(msg, resq.json().get('msg'))


# 读取测试数据文件
list_data = []
def read_json_data(filename):
    with open(filename, 'r', encoding='utf8') as f:
        data = json.load(f)
        #print("读到的文件数据为：", data)
        for i in data:
            list_data.append(tuple(i.values()))
        return list_data

